package com.xpgk.xpsoft.constants;

import com.xpgk.common.kit.CacheKitEx;

public class XPSoftConstant {
	static public XPSoftConstant me = new XPSoftConstant();
	static public String cacheName = "xpSoftCache";
	static public Integer systemID = 1;

	static public String cacheKey_Handle_RunState_Enable = "xpSoft_System_Handle_RunState_Enable";
	static public String cacheKey_Handle_RunState_Num = "xpSoft_System_Handle_Num";
	static public String cacheKey_Handle_RunState_Num50 = "xpSoft_System_Handle_Num50";
	static public String cacheKey_Handle_RunState_UseTime = "xpSoft_System_Handle_UseTime";
	static public long RunState_Num = 0;
	static public long RunState_Num50 = 0;
	static public long RunState_UseTime = 0;

	static public String cacheKey_System = "xpSoft_SystemID_" + systemID;

	static public int log_api = 1;
	static public int log_login = 2;// 登录管理
	static public int log_user = 3;// 用户管理
	static public int log_role = 4;// 角色管理
	static public int log_department = 5;// 部门管理
	static public int log_systemParam = 6;
	static public int log_code = 7;
	static public int log_system_alter = 8;// 系统报警通知单
	static public int log_carVindicate = 9;// 考车维护
	static public int log_videoVindicate = 10;// 视频参数维护
	static public int log_siteVindicate = 11;// 场地监控维护
	static public int log_pointVindicate = 12;// 坐标维护

	// user
	static public String cacheKey_User(int userID) {
		return "xpSoft_UserID_" + userID;
	}

	static public String cacheKey_UserID(String userName) {
		return "xpSoft_UserName_" + userName;
	}

	static public String cacheKey_UserRightID(int userID) {
		return "xpSoft_UserRightID_" + userID;
	}

	static public String cacheKey_UserMenu(int userID) {
		return "xpSoft_UserMenu_" + userID;
	}

	// frm_code
	static public String cacheKey_CodeTypeList = "xpSoft_CodeTypeList";

	static public String cacheKey_CodeList(Integer systemID, String type) {
		return "xpSoft_CodeList_" + systemID + "_" + type;
	}

	// frm_system
	static public String cacheKey_param(Integer systemID, String type) {
		return "xpSoft_SystemParam_" + systemID + "_" + type;
	}

	// FRM_DEPARTMENT
	static public String cacheKey_deptIDName = "xpSoft_Department_ID_Name";

	@SuppressWarnings("unchecked")
	public static <T> T getCache(Object key) {
		return (T) CacheKitEx.get(cacheName, key);
	}

	public static void put(Object key, Object value) {
		CacheKitEx.put(cacheName, key, value);
	}

	public static void remove(Object key) {
		CacheKitEx.remove(cacheName, key);
	}
}
